<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title><?php echo ($article["title"]); ?></title>
<link rel="stylesheet" href="/Public/index/myindex.css" media="screen" type="text/css" />
<script src="http://apps.bdimg.com/libs/jquery/2.1.1/jquery.min.js"></script>
<link rel="stylesheet" href="/Public/bootstrap/css/bootstrap.min.css">
<style>

.bottom{
	float:right;
	width:100%;

}
textarea{
	width:100%;
	border-radius: 4px;
}
.comment{
	display:none;
	background:#fff;
	padding:5px;
	border-radius: 4px;
	margin:5px;
}
.replycomment{
	float:right;
	cursor:pointer;
}
#reply{
		cursor:pointer;
}
.items{
	padding:2px;
}
.article_title{
	font-size:16px;
}
</style>
</head>
<body>
<style>
.welcome{
	margin:10px;
	color:#FFF;
}

.topnav{
position: fixed;
  _position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  _width: 98.7%;
  z-index: 5;
  min-width: 1004px;
  height: 28px;
  background: #555;;
  font-size: 12px;
  line-height: 22px;
  text-align: left;
}
.bar{
  height: 28px;
  line-height: 28px;
  padding: 4px 1px 4px 5px;
  overflow: hidden;
  cursor: pointer;
  color:#fff;
}
a{
	margin:5px;
	color:#fff;
}
</style>


<div class="topnav">
<?php if($_SESSION['username']== ''): ?><span class="bar" onclick="window.location.href='/index.php/Home/Login/index'">登录</span>
<span class="bar" onclick="window.location.href='/index.php/Home/Login/signup'">注册</span>
<?php else: ?>
<span class="welcome">欢迎你，<?php echo (session('username')); ?></span>
<span>|</span>
<span><a href="/index.php/Home/Index/logout">退出</a></span><?php endif; ?>
<span class="bar"onclick="window.location.href='/index.php/Home/Index/report'"><img src="/Public/images/iconfont-fabiao.png">&nbsp;写日志</span>
</div>
<meta charset="UTF-8">

	<style>
* {
	padding: 0;
	marging: 0;
}

body {
	background: #666;
	font-family: 'Quicksand', sans-serif;
}
.logo{
  padding: 30px 10px;
  width: 200px;
  text-align: center;
  color: #FFF;
  font-size: 20px;
  display:block;
  cursor:pointer;
}
.left {
	display: block;
	width: 200px;
	position: fixed;
	background: #222;
	bottom: 0;
	top: 28px;
}

.line {
	background: #363636;
	height: 1px;
	display: block;
	width: 100%;
}

.section {
	width: 100%;
	margin-left: 0px;
	position: relative;
	height: 37px;
	display: block;
	padding: 10px;
	border-bottom-style: solid;
	border-bottom-width: 1px;
	border-bottom-color: #363636;
	border-top-style: solid;
	border-top-width: 1px;
	border-top-color: #363636;
	cursor: pointer;
}

ul {
	color: #FFF;
}

li {
	list-style: none;
}

.selected {
	background: #363636;
}

.content {
	padding: 10px;
	margin-left: 10px;
	cursor: pointer;
	display: none;
}
.content li{
	margin:5px;
}
.selectli{
	border-bottom-style: solid;
	border-bottom-width: 1px;
	border-bottom-color: #363636;
}
a:link {text-decoration:none;color:#fff;}
a:visited {text-decoration:none;color:#fff;}
a:hover {text-decoration:none;color:#fff;}
a:active {text-decoration:none;color:#fff;}
</style>
	<div class="left">
		
		
		<span class="logo" onclick="window.location.href='/index.php/Home/Index/index.html'">
		LJM
		</span>
	<ul>
			<li><span class="section selected"> 文章分类 </span>
				
					<ul class="content"style="display:block;">
					<?php if(is_array($articletype)): $i = 0; $__LIST__ = $articletype;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><li onclick="show(<?php echo ($vo["id"]); ?>);"><?php echo ($vo["name"]); ?>(<?php echo ($vo["nums"]); ?>)</li><?php endforeach; endif; else: echo "" ;endif; ?>
					</ul>
			</li>
			<li><span class="section" id="function"> 功能中心 </span>
				
					<ul class="content" id="functionul" >
						<li><a href="/index.php/Admin/Index/index">后台管理</a></li>
						<li id="user"><a href="/index.php/Home/Index/user">个人中心</a></li>
					</ul>
				</li>
		</ul>
	</div>
<script>
$(".section").hover(function(){
	$(this).addClass("selected");
},function(){
	$(this).removeClass("selected");
});
$(".section").click(function(){
	$(this).next(".content").toggle(200);
});
$(".content li").hover(function(){
	$(this).addClass("selectli");
},function(){
	$(this).removeClass("selectli");
});
</script>
<script type="text/javascript">
//选择分类
function show(type){
	window.location.href="/index.php/Home/Index/index.html?type="+type;
}
$(function(){
	if("<?php echo (ACTION_NAME); ?>"=="user"){
		$("#function").addClass("selected");
		$("#user").addClass("selectli");
		$("#functionul").css("display","block");
	}
});
<?php echo (MODULE_NAME); ?>
<?php echo (CONTROLLER_NAME); ?>

</script>


<div class="article">
<div class="panel panel-default">
  <div class="panel-heading"><b class=""><?php echo ($article["title"]); ?> </b><span class="posttime">发表时期：<?php echo ($article["time"]); ?></span></div>
  <div class="panel-body" >
  <?php echo ($article["content"]); ?>  <div style="float:right"><span class="label label-default">分类:<?php echo ($article["type"]); ?></span><span style="color:green"></div>
  </div>

  </div>

    <div class="bottom">
        <?php if(is_array($articlecomment)): $i = 0; $__LIST__ = $articlecomment;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><div class="comment">
	<span style="color:green"><?php echo ($vo["username"]); ?>:</span>
    <?php echo ($vo["content"]); ?>
	<div class="replycomment" onclick="replycomment('<?php echo ($vo["id"]); ?>','<?php echo ($vo["username"]); ?>');">
	回复
	</div>
    </div><?php endforeach; endif; else: echo "" ;endif; ?>
    <p class="items">阅读(<?php echo ($article["veiw"]); ?>)|<span id="reply">评论(<?php echo ($article["replynums"]); ?>)</span>|<a href="/index.php/Home/Index/edit.html?id=<?php echo ($article["id"]); ?>">编辑</a>|<a href="/index.php/Admin/Index/delarticle.html?id=<?php echo ($article["id"]); ?>">删除</a></p>
  <div class="reply">
  <form action="/index.php/Home/Index/reply"method="post" onkeydown="if(event.ctrlKey&&event.keyCode==13)this.submit()">
  <p><textarea name="content" id="comment"></textarea></p>
  <input type="hidden" name="articleid" value="<?php echo ($article["id"]); ?>">
    <input type="hidden" name="username" value="<?php echo (session('username')); ?>">
  <p><input type="submit"value="发表评论" class="btn"></p>
  </form>
  </div>
  </div>
<script>
$("#reply").click(function(){
	$(".comment").toggle(300);
});

function replycomment(id,username){
	$("#comment").val("@"+username+": ");
}
	

</script>
</body>
</html>